<?php
namespace Admin\Controller;
class SendkeyController extends AdminBaseController
{
   public function index()
    {
        if(session('auid')==null){
            $this->display('index/login');
            exit();
        }
        $sendkey=M('Sendkey')->find(1);
        $this->assign('send',$sendkey);
        $this->display('sendkey/index');
        
    }
    
  public function update(){
       if(session('auid')==null){
            $this->display('index/login');
            exit();
        }
       $todomain=I('todomain','');
       $key=I('key','');
       $sign=I('sign','');
       if($todomain=='' || $key=='' || $sign==''){
        $map=array('status'=>2);
          $this->ajaxReturn($map,'JSON');
         exit();
       }
       M('Sendkey')->where('id=1')->setField(array('key'=>$key,'todomain'=>$todomain,'sign'=>$sign));
       $map=array('status'=>1);
       $this->ajaxReturn($map,'JSON');
       exit();
  }  

}